//
//  sortArray.cpp
//  cpp
//
//  Created by xueshan1 on 2019/10/14.
//  Copyright © 2019 xueshan1. All rights reserved.
//

#include <stdio.h>
#include <vector>

using namespace std;
using std :: vector;

#pragma mark -快速排序
void quicksort(int *a  ,int l, int r){
    if (l > r ) {
        return;
    }
    int i = l, j = r;
    int key = a[i];
    while (i < j) {
        while (i < j && a[j] > key ) {
            j--;
        }
        a[i] = a[j];
        while (i < j && a[i] < key ) {
            i++;
        }
        a[j] = a[i];
     }
    a[i] = key;
    for (int i = 0; i< 6; i++) {
          cout << a[i];
      }
    cout<< "\n";
    
    quicksort(a,l, i -1);
    quicksort(a,i+1,r);
}

 
